<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<html lang="en-us" xml:lang="en-us">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="DC.Type" content="topic">
  <meta name="DC.Title" content="Oracle Database">
  <meta name="product" content="">
  <meta name="DC.Relation" scheme="URI" content="en-us_topic_0000001839267033.html">
  <meta name="prodname" content="">
  <meta name="version" content="">
  <meta name="brand" content="30-OceanProtect Appliance 1.5.0-1.6.0 Help Center">
  <meta name="DC.Publisher" content="20240608">
  <meta name="DC.Format" content="XHTML">
  <meta name="DC.Identifier" content="EN-US_TOPIC_0000001792387980">
  <meta name="DC.Language" content="en-us">
  <link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
  <title>Oracle Database</title>
 </head>
 <body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px">
  <a name="EN-US_TOPIC_0000001792387980"></a><a name="EN-US_TOPIC_0000001792387980"></a>
  <h1 class="topictitle1">Oracle Database</h1>
  <div>
   <div class="section" id="EN-US_TOPIC_0000001792387980__section4543102195920">
    <a name="EN-US_TOPIC_0000001792387980__section4543102195920"></a><a name="section4543102195920"></a>
    <h4 class="sectiontitle">pre-freeze-script Script</h4>
    <p>The script content is as follows:</p>
    <pre class="screen">#!/bin/sh
ORACLE_HOME=<em><strong>Installation path of the Oracle database</strong></em>
FREEZEFILE=$ORACLE_HOME"/DBA_SCRIPTS/pre-freeze.sql"
FREEZELOG=$ORACLE_HOME"/DBA_SCRIPTS/pre-freeze.log"
if [ "$(id -u)" -eq "0" ]; then 
    echo "$ORACLE_HOME/bin/sqlplus 'sys/sys@KPNDB as sysdba' &lt;&lt;EOF" &gt; ${FREEZEFILE}
    echo "spool ${FREEZELOG};" &gt;&gt; ${FREEZEFILE}
    echo "alter database begin backup;" &gt;&gt; ${FREEZEFILE}
    echo "spool off;" &gt;&gt; ${FREEZEFILE}
    echo "EOF" &gt;&gt; ${FREEZEFILE}
    exec su oracle -c  ${FREEZEFILE}
    [ -f ${ FREEZELOG } ] &amp;&amp; rm -f ${ FREEZELOG }
fi</pre>
   </div>
   <div class="section" id="EN-US_TOPIC_0000001792387980__section655719346595">
    <a name="EN-US_TOPIC_0000001792387980__section655719346595"></a><a name="section655719346595"></a>
    <h4 class="sectiontitle">post-thaw-script Script</h4>
    <p>The script content is as follows:</p>
    <pre class="screen">#!/bin/sh
ORACLE_HOME=<em><strong>Installation path of the Oracle database</strong></em>
UNFREEZEFILE=$ORACLE_HOME"/DBA_SCRIPTS/post-thaw.sql"
UNFREEZELOG=$ORACLE_HOME"/DBA_SCRIPTS/post-thaw.log"
if [ "$(id -u)" -eq "0" ]; then 
    echo "$ORACLE_HOME/bin/sqlplus 'sys/sys@KPNDB as sysdba' &lt;&lt;EOF" &gt; ${UNFREEZEFILE}
    echo "spool ${UNFREEZELOG};" &gt;&gt; ${UNFREEZEFILE}
    echo "alter database end backup;" &gt;&gt; ${UNFREEZEFILE}
    echo "spool off;" &gt;&gt; ${UNFREEZEFILE}
    echo "EOF" &gt;&gt; ${UNFREEZEFILE}
    exec su oracle -c  ${UNFREEZEFILE}
    [ -f ${UNFREEZEFILE} ] &amp;&amp; rm -f ${UNFREEZEFILE}
fi</pre>
   </div>
  </div>
  <div>
   <div class="familylinks">
    <div class="parentlink">
     <strong>Parent topic:</strong> <a href="en-us_topic_0000001839267033.html">Step 3: Configuring the Application-Consistent Backup Script</a>
    </div>
   </div>
  </div>
 </body>
</html>